#ifndef ADDCATEGORY_H
#define ADDCATEGORY_H

#include <head/g_pch.h>
#include "m_fhs.h"

namespace Ui {
class AddCategory;
}

class AddCategory : public QDialog
{
    Q_OBJECT

public:
    explicit AddCategory(QWidget *parent = nullptr);
    ~AddCategory();

    void setItem(const QString &category,
                 const QStringList &properties,
                 const QStringList &columns);

signals:
    void addItem(const QJsonObject &object);
    void updateItem(const QJsonArray &array);

private slots:
    void on_btn_submit_clicked();
    void on_btn_add_clicked();
    void on_btn_remove_clicked();

private:
    Ui::AddCategory *ui;

    bool editFlag;
    QStringList _properties,_columns;
    QStandardItemModel *model;
};

#endif // ADDCATEGORY_H
